package com.bruce.downloader;

import com.bruce.downloader.download.FileDownloader;
import com.bruce.downloader.download.MultipleDownloader;

import java.io.IOException;

public class DownloadMain {
    public static void main(String[] args) throws IOException {
        //String url = "https://download.ydstatic.com/notewebsite/downloads/YNote.exe";
        String url = "https://github.com/Fndroid/clash_for_windows_pkg/releases/download/0.18.1/Clash.for.Windows.Setup.0.18.1.exe";
        String dirPath = "E:\\download\\";
        multipleThreadDownload(url,dirPath);
        //singleThreadDownload(url,dirPath);
    }

    private static void singleThreadDownload(String url,String dirPath) throws IOException {
        FileDownloader downloader = new FileDownloader();
        downloader.download(url,dirPath);
    }

    private static void multipleThreadDownload(String url,String dirPath) throws IOException {
        MultipleDownloader downloader = new MultipleDownloader();
        downloader.download(url,dirPath);
    }
}
